<div class="modal-dialog" role="document">
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
            <h4 class="modal-title" id="exampleModalLabel">修改部门</h4>
        </div>
        <form style="margin:4%;" id="modalForm">
            <input type="hidden" value="{$orgInfo.id}" name="orgId" />
            <div class="form-group">
                <label class="control-label">部门名称:</label>
                <input type="text" class="form-control" name="name" value="{$orgInfo.name}" placeholder="请输入机构名称">
            </div>
            <div class="form-group">
                <label class="control-label">上级部门:</label>
                <select name="pid" class="form-control">
                    <option value="">作为顶级部门</option>
                    <foreach name="orgList" item="org">
                        <option value="{$org.id}" <if condition="$org['id'] eq $orgInfo['pid']">selected</if>>{$org.name}</option>
                    </foreach>
                </select>
            </div>
            <div class="form-group">
                <label class="control-label">简介:</label>
                <textarea class="form-control" rows="3" name="introduce">{$orgInfo.introduce}</textarea>
            </div>
        </form>
        <div class="modal-footer">
            <button type="button" data-dismiss="modal" class="btn btn-default">取消</button>
            <button type="button" id="OrgSave" class="btn btn-primary">保存</button>
        </div>
    </div>
</div>
<script type="text/javascript">

    $("#OrgSave").click(function(){
        common.ajax("{:U('Admin/Org/saveOrg')}",$("#modalForm").serialize(),function(){
            $("#commonModal").modal('toggle');
            common.reload();
        });
    });
</script>